package com.guoxin.part3;

/**
 * @author guoxin
 * @date 2019/8/30
 */
public final class Singleton {
    private byte[] data = new byte[1024];
    private volatile static Singleton singleton;

    private Singleton() {
    }

    public static Singleton getInstance() {
        if (singleton == null) {
            synchronized (Singleton.class) {
                if (singleton == null) {
                    singleton = new Singleton();
                }
            }
        }
        return singleton;
    }

}
